﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DTO;
using Business;

namespace Airplane
{
    public partial class ThacMac : System.Web.UI.Page
    {
        ThacMacDTO tm = new ThacMacDTO();       
        protected void Page_Load(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 0;
        }

        public void GuiThacMac()
        {
            tm.TieuDe = txtTieuDe.Text;
            tm.LoaiThacMac = txtLoaiThacMac.Text;
            tm.NoiDung = txtNoiDung.Text;
            tm.EmailNguoiGui = txtEmailNguoiGui.Text;
            XuLyThacMac xltm = new XuLyThacMac();
            xltm.Thacmac = tm;
            xltm.ThucThi();
        }
        protected void btnGui_Click(object sender, EventArgs e)
        {
            try
            {
                GuiThacMac();
                MultiView1.ActiveViewIndex = 1;
            }
            catch
            {
                lbThacMac.Text = "Chưa thể gửi thắc mắc";
            }
        }
    }
}